<!DOCTYPE html>
<html>
<head>
<#include "../common/head.ftl">
</head>

<body>
<div class="wrapper2">
    <form class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-1 control-label">类型</label>
            <div class="col-sm-4">
                <select class="form-control" name="type">
                    <option value="0">统采</option>
                    <option value="1">地采</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">流程配置：</label>
            <div class="col-sm-10 required">
                <div class="grid-wrapper">
                    <table id="grid"></table>
                </div>
            </div>
        </div>
        <div class="form-group form-btn-group">
            <div class="col-sm-12 text-right">
                <button type="submit" class="btn btn-primary">确认</button>
                <button type="button" id="cancel_btn" class="btn btn-default">取消</button>
            </div>
        </div>
    </form>
</div>
<div id="p_sys_res_tree_wrapper" class="ztree_select">
    <ul id="p_sys_res_tree" class="ztree" style="margin-top:0; max-height:200px;overflow:auto"></ul>
</div>
</body>
<#include "../common/scripts.ftl">
<script type="text/javascript">
    var pwin = window.pwin;

    $("#cancel_btn").on("click",function(){
        pwin.layer.closeAll();
    });

    var grid;
    grid = $("#grid").jqGrid({
        height: Public._win.gridBigHeight(),
        datatype: 'local',
        data: [
            {m:{'currentNodeType':1}}
        ],
        autowidth:false,
        rowNum:1000,
        cellEdit:true,//是否开启单元格的编辑功能
        cellsubmit:'clientArray',//or 'clientArray',remote代表每次编辑提交后进行服务器保存，clientArray只保存到数据表格不保存到服务器
        colModel: [
            {label:"操作",name:"ctrl",width:20,formatter:function(val,opt,obj){
                    var html = "<div class='operating'>";
                    html += "<shiro:hasPermission name='sys_resource:edit'><span class='fa fa-edit edit_btn' title='修改' data-id='"+obj.m.id+"'></span>&nbsp;&nbsp;</shiro:hasPermission>";
                    html += "<shiro:hasPermission name='sys_resource:delete'><span class='fa fa-trash delete_btn' title='删除' data-id='"+obj.m.id+"'></span></shiro:hasPermission>";
                    html += "</div>";
                    return html;
                }},
            {label:"ID",name:"m.id",key:true,hidden:true},
            {label:"名称",name:"m.flowName",width:40},
            {label:"当前节点名称",name:"m.currentNodeName",width:40,editable:true},
            {label:"当前节点类型",name:"m.currentNodeType",width:40,formatter: "select",editable:true,edittype:"select",editoptions: {value:"1:普通节点;2:会签节点;2:抢占节点"}},
            {label:"下一节点名称",name:"m.nextNodeName",width:40,editable:true},
            {label:"下一节点类型",name:"m.nextNodeType",width:40,formatter: "select",editable:true,edittype:"select",editoptions:{value:"1:普通节点;2:会签节点;2:抢占节点"}},
            {label:"操作名称",name:"m.btnChnName",width:40,editable:true},
            {label:"操作类型",name:"m.operateType",width:40,formatter: "select",editable:true,edittype:"select",editoptions:{value:"1:提交;2:转交;2:通过;3:驳回"}}
        ],
        loadComplete : function() {

        },
        gridComplete : function() {
            setTimeout(function() {
                Public._grid.autoSize(grid);
            }, 10);
        }
    });


</script>
</html>